<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="IE=edge" >
    <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"/>
    <title>Aliplayer Functions</title>
    <link rel="stylesheet" href="https://g.alicdn.com/de/prismplayer/2.9.19/skins/default/aliplayer-min.css" />
    <script type="text/javascript" charset="utf-8" src="https://g.alicdn.com/de/prismplayer/2.9.19/aliplayer-min.js"></script>
    <!-- 请下载之后使用 -->
    <script type="text/javascript" charset="utf-8" src="/aliplay/aliplayercomponents-1.0.8.min.js"></script>
</head>
<body>
<div id="player-con"></div>
<script>
    const saveTime = function (memoryVideo,currentTime) {
        localStorage.setItem(memoryVideo, currentTime);
    }

    const getTime = function (memoryVideo) {
        //return返回的是自定义起播时间
        return localStorage.getItem(memoryVideo)
    }
    var player = new Aliplayer({
        id: "player-con",
        source: "http://localhost/player?videoUrl=Video6.mp4",
        width: "100%",
        height: "500px",
        autoplay: true,
        isLive: false,
        components: [{
            name: 'MemoryPlayComponent',
            type: AliPlayerComponent.MemoryPlayComponent,
            args:[false,getTime,saveTime]
        }]
    }, function (player) {
        console.log("The player is created");
    });
</script>
</body>
</html>
